<!--
 * @Description: 
 * @Author: huacong
 * @Date: 2020-04-20 11:42:48
 * @LastEditTime: 2020-09-03 13:18:26
 * @LastEditors: huacong
--> 
<template lang="pug">
  el-dialog(
    title="认证详情"
    :visible="visible"
    width="720px"
    center
    append-to-body
    @close="closeHandle"
  )
    el-row(:gutter="24")
      el-col(:span="14")
        el-card
          h2.tc.mb10 {{info.status === '3' || type === 3 ? '现场认证照' : '全景照'}}
          a-image(
            :url="type === 2 ? (info.status === '3' ? info.recogAddress : info.backgroundUrl) : type === 3 ? info.recogAddress : info.backgroundUrl"
            height="360px"
          )
      el-col(:span="10")
        el-card
          h2.tc.mb10 {{info.status === '3' || type === 3 ? '患者模板照' : '认证照'}}
          a-image(
            :url="type === 2 ? (info.status === '3' ? info.headPhoto1 : info.recogAddress) : type === 1 ? info.recogAddress : info.mheadPhoto"
            height="170px"
          )
          .picInfo(v-if="type === 1 || (type === 2 && info.status !== '3')")
            p(class="f16 c_secondary") 
              span.mr20 {{info.name}}
              | {{info.idcard}}
          .picInfo(v-if="type === 3")
            p(class="f16 c_secondary") 
              span.mr20 {{info.mname}}
              | {{info.midcard}}
        el-card.mt20
          h2.tc.mb10 {{info.status === '3' || type === 3 ? '代办人模板照' : '模板照'}}
          a-image(
            :url="type === 2 ? info.headPhoto2 : type === 3 ? info.pheadPhoto : info.idcardPhoto || info.headPhoto1 || info.pheadPhoto"
            height="170px"
          )
          .picInfo(v-if="type === 1")
            p(class="f16 c_secondary") 
              span.mr20 {{info.name}}
              | {{info.idcard}}
          .picInfo(v-if="type === 2 && info.status === '3'")
            p(class="f16 c_secondary") 
              span.mr20 {{info.relativeName}}
              | {{info.relativeIdcard}}
          .picInfo(v-if="type === 3")
            p(class="f16 c_secondary") 
              span.mr20 {{info.pname}}
              | {{info.pidcard}}
</template>
<script>
import { AImage } from '@/components'
export default {
  name: 'ImageModel',
  components: {
    AImage
  },
  props: {
    //1、普通购药，2、门特购药 3： 委托购药
    type: {
      type: Number,
      default: 0
    },
    info: {
      type: Object,
      default:() => {}
    },
    visible: {
      type: Boolean,
      default: false
    }
  },
  model: {
    prop: 'visible',
    event: 'visibleToggle'
  },
  data () {
    return {
      loading: false
    }
  },
  methods: {
    closeHandle () {
      this.$emit('visibleToggle')
    }
  }
}
</script>
